<%@ page import="com.blog.pojo.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改用户信息</title>
    <link rel="icon" href="./favicon/favicon.ico" type="image/x-icon">
    <style>
        body { font-family: Arial, sans-serif; margin: 40px; }
        label { display: block; margin: 10px 0 5px; }
        input[type="text"] { width: 300px; padding: 8px; }
        button { margin-top: 20px; padding: 10px 20px; }
    </style>
</head>
<body>
<%
    User user = (User) request.getAttribute("user");
%>
<h2>修改用户信息</h2>

<form action="userServlet?method=updateUser" method="post">

    <input type="hidden" name="id" value="<%= user.getId() %>">

    <div>
        <label>用户名</label>
        <input type="text" name="username" value="<%= user.getUsername() %>" required>
    </div>
    <div>
        <label>密码</label>

        <input type="text" name="password" value="<%= user.getPassword() %>" required>
    </div>

    <div>
        <label>电话</label>
        <input type="text" name="phone" value="<%= user.getPhone() %>" required>
    </div>

    <button type="submit">保存</button>
    <a href="userServlet?method=findById&id=<%= user.getId() %>">取消</a>
</form>
</body>
</html>